1 00:00:00,660 --> 00:00:01,810 Hello and welcome. 2 00:00:01,810 --> 00:00:10,620 In this video I'm going to quickly run through the pounds to kilogramme conversion tool the call his 3 00:00:10,620 --> 00:00:19,260 very identical for the code we use for the killer ground to pound conversions so I'm not going to explain 4 00:00:19,290 --> 00:00:22,160 to Mike because the chords is identical. 5 00:00:22,350 --> 00:00:26,790 I will only focus on the areas that are different. 6 00:00:26,950 --> 00:00:37,110 So this is the hastier male for the pounds 2 kg I have called it p to cagy to hate mail and I've saved 7 00:00:37,110 --> 00:00:44,140 it inside the same directory as the kilogram two pound conversion. 8 00:00:44,160 --> 00:00:48,650 So all the files are gonna be in the same directly but I have given them different names. 9 00:00:48,900 --> 00:00:53,790 So this is the highest email for the pownce to kilogramme which I have caught. 10 00:00:54,010 --> 00:00:56,210 P to Katie's or his team. 11 00:00:56,280 --> 00:00:59,280 So the email is basically the same. 12 00:00:59,280 --> 00:01:01,860 The only thing that's changed here is the title. 13 00:01:01,890 --> 00:01:09,380 I've changed the title to parts of kilogramme weight compared to the CNS is all I've done is changed 14 00:01:09,380 --> 00:01:17,730 the name of the CSA So they are going to use the same C Ss type just change to name contain the same 15 00:01:17,730 --> 00:01:18,830 thing again. 16 00:01:18,900 --> 00:01:23,850 The code is saying All I've done here change the title fully hate one tag to wait. 17 00:01:23,850 --> 00:01:25,610 Convert time lbs. 18 00:01:25,780 --> 00:01:28,400 Here is a clock tower. 19 00:01:28,530 --> 00:01:35,120 Your weight value in pounds because we're converted from Pants shoe kilos here. 20 00:01:35,130 --> 00:01:37,600 The labels obviously is changed. 21 00:01:37,610 --> 00:01:45,100 So where we had the label in kilograms when we do the kilogram one here we've got a label same pounds 22 00:01:45,150 --> 00:01:48,670 so they're going to import the value in pounds. 23 00:01:48,840 --> 00:01:51,580 Also being put tidy has changed. 24 00:01:51,790 --> 00:01:57,090 Where in the kilogram a pound we weigh in put in kilograms. 25 00:01:57,090 --> 00:01:59,210 Now we import impoundments. 26 00:01:59,460 --> 00:02:02,240 The type is no the type of input. 27 00:02:02,670 --> 00:02:04,980 And then replace or die inside the place or. 28 00:02:05,000 --> 00:02:10,200 I am just going to have lb in there and bet on input. 29 00:02:10,290 --> 00:02:12,850 Again we're going to use the same function. 30 00:02:12,850 --> 00:02:19,700 I've called it the same name wave converter function and this will grab whatever value you input into 31 00:02:19,710 --> 00:02:21,390 this input field. 32 00:02:21,570 --> 00:02:30,600 This bisley is this is a key word is use to access the current value and these function here code with 33 00:02:30,600 --> 00:02:36,870 converter will do the conversion from pownce to kg on change. 34 00:02:36,870 --> 00:02:44,420 This metaphysically this attribute here we'll call this function when the values. 35 00:02:44,490 --> 00:02:51,240 Each time you enter a new value into the input it will trigger this change here event that will call 36 00:02:51,270 --> 00:02:53,260 this function. 37 00:02:53,460 --> 00:02:59,280 Okay and what about value you've entered would be re calculate it. 38 00:02:59,380 --> 00:03:07,350 Again this is just a paragraph that will import the value of the leithead Conversion. 39 00:03:07,350 --> 00:03:12,130 It will happen that you in this band element to this text here. 40 00:03:12,270 --> 00:03:17,240 My 22 is just a reference to the external javascript. 41 00:03:17,340 --> 00:03:23,170 Again like the kilogram to I've just call it to key. 42 00:03:23,210 --> 00:03:30,590 It's a very basic stuff similar to what we did with the kilogramme two point conversion. 43 00:03:30,680 --> 00:03:32,230 So this is the hastier about. 44 00:03:32,430 --> 00:03:34,030 Let's take a look at a java script. 45 00:03:34,020 --> 00:03:44,490 This is a javascript I have used for the pounds 2 kg is basically the same thing as we did with the 46 00:03:44,520 --> 00:03:48,850 kilogramme to point a game with a function called Wave converter. 47 00:03:48,960 --> 00:03:54,310 We aren't grabbing the value of the number that is passed into the input field. 48 00:03:54,450 --> 00:04:00,180 Here I've created two variables one for the value of the number and I send that to you. 49 00:04:00,210 --> 00:04:01,660 So the value of no. 50 00:04:01,710 --> 00:04:16,350 The only difference here with pounds 2 kg conversion we more plight so one kg basically said is is going 51 00:04:16,350 --> 00:04:17,950 to be divided by. 52 00:04:18,030 --> 00:04:27,020 So to get the value of the conversion you divide okay by this number. 53 00:04:27,030 --> 00:04:34,020 Remember when we did the key to point we multiplied. 54 00:04:34,050 --> 00:04:43,160 So here we are dividing rather than multiply as will multiply the value by two point to zero for six. 55 00:04:43,200 --> 00:04:47,370 So that's the key difference between the two kg to pound. 56 00:04:47,370 --> 00:04:50,680 You multiply this value down 2 kg. 57 00:04:50,700 --> 00:04:57,000 You divide the value variable here code n we grab in this variable. 58 00:04:57,010 --> 00:04:59,830 Here we are set in we is in this to fix it. 59 00:05:00,050 --> 00:05:08,220 To round up the value to zero decimal places so we can just get whole numbers are posted rather than 60 00:05:08,220 --> 00:05:09,570 several numbers. 61 00:05:09,570 --> 00:05:16,800 So if you wanted to prefix yours to two decimal places you can just put two there I've put in has zero 62 00:05:16,830 --> 00:05:20,500 cause I don't want any decimal places. 63 00:05:20,510 --> 00:05:29,520 And so I have put a value of c again like the kilogram two point conversion We years in a document. 64 00:05:29,520 --> 00:05:29,720 OK. 65 00:05:29,730 --> 00:05:30,740 Elemen by T. 66 00:05:30,750 --> 00:05:36,350 And we get in this I'll put KG So if we go into the hastier mill This is what we grab. 67 00:05:36,390 --> 00:05:39,760 This is the idea of this span element here. 68 00:05:40,070 --> 00:05:49,420 We'll in that and whatever value is imported from the value of this couple lation we are going to add 69 00:05:49,420 --> 00:05:52,920 that to these outputs. 70 00:05:52,940 --> 00:05:59,550 KG So if you go here you can see this our PUD kg's is going to spend this to this to see your weight 71 00:05:59,580 --> 00:06:06,720 in kilograms is where there are put at for that kilograms so that's basically it. 72 00:06:06,720 --> 00:06:14,600 All right so the code is basically a complete is identical to what we did with the kilogram two point 73 00:06:14,600 --> 00:06:15,210 conversion. 74 00:06:15,210 --> 00:06:21,750 The other key difference is that with a kilogram two pounds you multiply it by this number whereas with 75 00:06:21,750 --> 00:06:26,780 the pound two kilogram conversion you are dividing by the number. 76 00:06:27,090 --> 00:06:35,090 Again this here says I have used exactly the same assess for this pound two kilogram conversion two 77 00:06:35,100 --> 00:06:42,180 because all I'm doing this time in the container which I have is to allow it and I've done is just changed 78 00:06:42,180 --> 00:06:45,810 a colour where the kilogram to pound. 79 00:06:45,840 --> 00:06:52,680 I use it purple colour for the background here I am in a blue colour for the background so that's basically 80 00:06:52,740 --> 00:06:53,660 it. 81 00:06:53,670 --> 00:06:57,000 So let me see that and then we can run it. 82 00:06:57,360 --> 00:07:01,700 So these are all the farms inside this same directory. 83 00:07:01,920 --> 00:07:08,420 So the one we've just created here is a pound to kilograms a wing a rum in your file that is the hastier 84 00:07:08,430 --> 00:07:13,680 mail file you need to run because it's linked to the old farts someone from the pound to kilogramme 85 00:07:13,680 --> 00:07:19,550 conversion to wishes this one double click and he can see five. 86 00:07:19,560 --> 00:07:21,590 Type in and find the compound. 87 00:07:21,780 --> 00:07:22,290 He can see. 88 00:07:22,290 --> 00:07:26,230 Gives me the corresponding value in kilograms. 89 00:07:26,250 --> 00:07:28,740 So this concludes the projet. 90 00:07:28,800 --> 00:07:33,710 If you have any issues at all please do not hesitate to contact me. 91 00:07:33,930 --> 00:07:36,450 Be more than happy to assist. 92 00:07:36,450 --> 00:07:37,460 Thanks very much. 93 00:07:37,470 --> 00:07:39,240 Take care and all the best. 94 00:07:39,240 --> 00:07:40,140 Bye for now.